#include<iostream>
#include<cstring>
using namespace std;
#define ll long long

char s[5000];
ll b, c[5000], x , a[5000], la, lc;


int main(){
    cin>>s>>b;
    la = strlen(s);

    for(int i = 1; i <= la; i++){
        a[i] = s[i-1]-'0';
    }

    for(int i = 1; i <= la; i++){
        c[i] = (x*10 + a[i])/b;
        x = (x*10 + a[i])%b;
    }
    lc = 1;
    while(c[lc]==0 && lc<la)lc++;

    for(int i = lc; i <= la; i++) cout << c[i];
    return 0;
}